package com.xieyingwangluo.yxpart.api;


import com.xieyingwangluo.yxpart.bean.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@Api(tags = "不能使用,编写中.....skill接口")
@Controller
@RequestMapping(value = "/api/v1/skill")
public class SkillBaseRest extends BaseRest {
    @ApiOperation(value = "添加技能证书", notes = "添加技能证书", produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "name", value = "名称", required = true, dataType = "String", paramType = "form", defaultValue = "计算机二级"),
            @ApiImplicitParam(name = "numb", value = "证书编号", required = true, dataType = "String", paramType = "form", defaultValue = "20181989089087"),
            @ApiImplicitParam(name = "info", value = "描述", required = true, dataType = "String", paramType = "form", defaultValue = "计算机二级证书"),
            @ApiImplicitParam(name = "user_id", value = "用户id", required = true, dataType = "String", paramType = "form", defaultValue = "123456")
    })
    @ResponseBody
    @PostMapping(value = "/add")
    public Result add(@RequestHeader(name = "Authorization", defaultValue = "token") String token,
                      @RequestParam("name") String name,
                      @RequestParam("numb") String numb,
                      @RequestParam("info") String info,
                      @RequestParam("user_id") String user_id
    ) {
        logger.info("获取技能证书信息 start....");
        return Result.generate(0, "添加成功", null);
    }

    @ApiOperation(value = "修改技能证书", notes = "修改修改技能证书", produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "noid", value = "技能证书编号", required = true, dataType = "String", paramType = "query", defaultValue = "123456"),
            @ApiImplicitParam(name = "name", value = "名称", required = true, dataType = "String", paramType = "query", defaultValue = "计算机二级"),
            @ApiImplicitParam(name = "numb", value = "证书编号", required = true, dataType = "String", paramType = "query", defaultValue = "20181989089087"),
            @ApiImplicitParam(name = "info", value = "描述", required = true, dataType = "String", paramType = "query", defaultValue = "计算机二级证书"),
            @ApiImplicitParam(name = "user_id", value = "用户id", required = true, dataType = "String", paramType = "query", defaultValue = "123456")
    })
    @ResponseBody
    @PutMapping(value = "/upd")
    public Result update(@RequestHeader(name = "Authorization", defaultValue = "token") String token,
                         @RequestParam("noid") String noid,
                         @RequestParam("name") String name,
                         @RequestParam("numb") String numb,
                         @RequestParam("info") String info,
                         @RequestParam("user_id") String user_id
    ) {
        logger.info("获取技能证书信息 start....");
        return Result.generate(0, "修改成功", null);
    }
    //显示：用户教育经历编号（noid）

    @ApiOperation(value = "显示技能证书", notes = "显示显示技能证书", produces = "application/json")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "noid", value = "技能证书id", required = true, dataType = "String", paramType = "query", defaultValue = "123456")
    })
    @ResponseBody
    @GetMapping(value = "/selO")
    public Result selO(@RequestHeader(name = "Authorization", defaultValue = "token") String token,
                       @RequestParam("noid") String noid
    ) {
        logger.info("获取技能证书信息 start....");
        return Result.generate(0, "查询成功", null);
    }
}
